home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlIpAddressShowHide.au3 < prev    next >
Text File  |  2007-09-08  |  900b  |  38 lines

  1. #include <GuiIPAddress.au3>
  2.  
  3. Opt("MustDeclareVars", 1)
  4.  
  5. _Main()
  6.  
  7. Func _Main()
  8.     Local $msg, $hgui, $btn_show, $button, $hIPAddress, $Visible = True
  9.     
  10.     $hgui = GUICreate("IP Address Control Show/Hide Example", 300, 150)
  11.     
  12.     $hIPAddress = _GUICtrlIpAddressCreate ($hgui, 10, 10, 150, 30,  $WS_DLGFRAME, $WS_EX_CLIENTEDGE)
  13.     _GUICtrlIpAddressSet ($hIPAddress, "24.168.2.128")
  14.     
  15.     $btn_show = GUICtrlCreateButton("Show/Hide", 10, 50, 100, 25)
  16.     
  17.     $button = GUICtrlCreateButton("Exit", 100, 120, 100, 25)
  18.  
  19.     GUISetState(@SW_SHOW)
  20.  
  21.  
  22.     While 1
  23.         $msg = GUIGetMsg()
  24.         
  25.         Select
  26.             Case $msg = $GUI_EVENT_CLOSE Or $msg = $button
  27.                 Exit
  28.             Case $msg = $btn_show
  29.                 If $Visible Then
  30.                     _GUICtrlIpAddressShowHide ($hIPAddress, @SW_HIDE)
  31.                 Else
  32.                     _GUICtrlIpAddressShowHide ($hIPAddress, @SW_SHOW)
  33.                 EndIf
  34.                 $Visible = Not $Visible
  35.         EndSelect
  36.     WEnd
  37. EndFunc   ;==>_Main
  38.